<template>
  <div class="contaion">
    <div
      id="divPlugin"
      style="width: 500px; height: 300px; margin-left: 100px"
    ></div>
  </div>
</template>
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from "vue";

function initPlugin() {
  WebVideoCtrl.I_InitPlugin({
    bWndFull: true, //Wether support doule clicking to switch the full-screen mode: it's supported by default; true:support, false:not support
    iWndowType: 1,
    cbInitPluginComplete: function () {
      WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(
        () => {
          WebVideoCtrl.I_CheckPluginVersion().then((bFlag) => {
            if (bFlag) {
              alert(
                "Detect the latest version, please double click HCWebSDKPlugin.exe to update!"
              );
            }
          });
        },
        () => {
          alert(
            "The plugin initialization failed. Please confirm if the plugin has been installed; If not installed, please double click on HCWebSDKPlugin.exe to install it!"
          );
        }
      );
    },
  });
}

function clickLogin() {
  WebVideoCtrl.I_Login("192.168.50.164", 1, "80", "admin", "abzy2024", {
    timeout: 3000,
    success: function (xmlDoc) {
      console.log("登录成功！", xmlDoc);
    },
    error: function (oError) {
      console.log("登录失败", oError);
    },
  });
}


onMounted(() => {});
</script>

<style></style>
